server {
    root /home/szh/faye/public/;
    server_name faye.com;
    location /{
        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Allow-Headers Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,X-Data-Type,X-Requested-With;
        add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS;
        add_header Access-Control-Allow-Credentials true;
        if ($request_method = 'OPTIONS') {
            return 204;
        }
        proxy_http_version 1.1;
        proxy_set_header Connection "keep-alive";
        proxy_set_header X-Real-IP $remote_addr;
        if (!-f $request_filename) {
             proxy_pass http://127.0.0.1:9501;
        }

    }
}

